package com.cskaoyan.javase.oop2._1extends._8initialization._2classload;

/**
 * 如果一个类有多个父类,那么触发该子类的类加载
 * 会从顶层父类开始,向下完成类加载
 *
 * @since 11:20
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo extends Son{
    public static void main(String[] args) {
        // Son s = new Son();
        // System.out.println(Son.num);
    }
}

class Grandfather {
    static {
        System.out.println("Grandfather");
    }
}

class Father extends Grandfather {
    static {
        System.out.println("Father");
    }

}

class Son extends Father {
    static int num;
    static {
        System.out.println("Son");
    }
}
